<template>
  <div>
    <p>{{ word }}</p>
    <button @click="jokeBtnFn">点击</button>
  </div>
</template>

<script>
export default {
  name: "VuecliDemoApp",

  data() {
    return {
      word: "金庸武侠",
      jokeArr: ["飞雪连天射白鹿", "笑书神侠倚碧鸳", "越女剑"],
    };
  },

  mounted() {},

  methods: {
    jokeBtnFn() {
      let randNum = Math.floor(Math.random() * this.jokeArr.length);
      console.log(randNum);
      this.word = this.jokeArr[randNum];
    },
  },
};
</script>

<style lang="scss" scoped>
</style>